1 /*
2 
3 Boost Software License - Version 1.0 - August 17th, 2003
4 
5 Permission is hereby granted, free of charge, to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license (the "Software") to use, reproduce, display, distribute,
8 execute, and transmit the Software, and to prepare derivative works of the
9 Software, and to permit third-parties to whom the Software is furnished to
10 do so, all subject to the following:
11 
12 The copyright notices in the Software and this entire statement, including
13 the above license grant, this restriction and the following disclaimer,
14 must be included in all copies of the Software, in whole or in part, and
15 all derivative works of the Software, unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26 
27 */
28 module derelict.anttweakbar.functions;
29 
30 private
31 {
32     import core.stdc.config;
33     import derelict.anttweakbar.types;
34 }
35 
36 
37 
38 extern(System)
39 {
40 	alias nothrow TwBar* function(const(char)* barName) da_TwNewBar;
41 	alias nothrow int function(TwBar* bar) da_TwDeleteBar;
42 	alias nothrow int function() da_TwDeleteAllBars;
43 	alias nothrow int function(const(TwBar)* bar) da_TwSetTopBar;
44 	alias nothrow TwBar* function() da_TwGetTopBar;
45 	alias nothrow int function(const(TwBar)* bar) da_TwSetBottomBar;
46 	alias nothrow TwBar* function() da_TwGetBottomBar;
47 	alias nothrow const(char)* function(const(TwBar)* bar) da_TwGetBarName;
48 	alias nothrow int function() da_TwGetBarCount;
49 	alias nothrow TwBar* function(int barIndex) da_TwGetBarByIndex;
50 	alias nothrow TwBar* function(const(char)* barName) da_TwGetBarByName;
51 	alias nothrow int function(TwBar* bar) da_TwRefreshBar;
52 	alias nothrow int function(TwBar* bar, const(char)* name, TwType type, void* var, const(char)* def) da_TwAddVarRW;
53 	alias nothrow int function(TwBar* bar, const(char)* name, TwType type, const(void)* var, const(char)* def) da_TwAddVarRO;
54 	alias nothrow int function(TwBar* bar, const(char)* name, TwType type, TwSetVarCallback setCallback, TwGetVarCallback getCallback, void* clientData, const(char)* def) da_TwAddVarCB;
55 	alias nothrow int function(TwBar* bar, const(char)* name, TwButtonCallback callback, void* clientData, const(char)* def) da_TwAddButton;
56 	alias nothrow int function(TwBar* bar, const(char)* name, const(char)* def) da_TwAddSeparator;
57 	alias nothrow int function(TwBar* bar, const(char)* name) da_TwRemoveVar;
58 	alias nothrow int function(TwBar* bar) da_TwRemoveAllVars;
59 	alias nothrow int function(const(char)* def) da_TwDefine;
60 	alias nothrow TwType function(const(char)* name, const(TwEnumVal)* enumValues, uint nbValues) da_TwDefineEnum;
61 	alias nothrow TwType function(const(char)* name, const(char)* enumString) da_TwDefineEnumFromString;
62 	alias nothrow TwType function(const(char)* name, const(TwStructMember)* structMembers, uint nbMembers, size_t structSize, TwSummaryCallback summaryCallback, void* summaryClientData) da_TwDefineStruct;
63 	alias nothrow void function(TwCopyCDStringToClient copyCDStringFunc) da_TwCopyCDStringToClientFunc;
64 	alias nothrow void function(char** destinationLibraryStringPtr, const(char)* sourceClientString) da_TwCopyCDStringToLibrary;
65 	alias nothrow int function(TwBar* bar, const(char)* varName, const(char)* paramName, TwParamValueType paramValueType, uint outValueMaxCount, void* outValues) da_TwGetParam;
66 	alias nothrow int function(TwBar* bar, const(char)* varName, const(char)* paramName, TwParamValueType paramValueType, uint inValueCount, const(void)* inValues) da_TwSetParam;
67 	alias nothrow int function(TwGraphAPI graphAPI, void* device) da_TwInit;
68 	alias nothrow int function() da_TwTerminate;
69 	alias nothrow int function() da_TwDraw;
70 	alias nothrow int function(int width, int height) da_TwWindowSize;
71 	alias nothrow int function(int windowID) da_TwSetCurrentWindow;
72 	alias nothrow int function() da_TwGetCurrentWindow;
73 	alias nothrow int function(int windowID) da_TwWindowExists;
74 	alias nothrow int function(int key, int modifiers) da_TwKeyPressed;
75 	alias nothrow int function(int key, int modifiers) da_TwKeyTest;
76 	alias nothrow int function(TwMouseAction action, TwMouseButtonID button) da_TwMouseButton;
77 	alias nothrow int function(int mouseX, int mouseY) da_TwMouseMotion;
78 	alias nothrow int function(int pos) da_TwMouseWheel;
79 	alias nothrow const(char)* function() da_TwGetLastError;
80 	alias nothrow void function(TwErrorHandler errorHandler) da_TwHandleErrors;
81 	alias nothrow int function(void* wnd, uint msg, uint wParam, int lParam) da_TwEventWin;
82 	alias nothrow int function(const(void)* sdlEvent, ubyte sdlMajorVersion, ubyte sdlMinorVersion) da_TwEventSDL;
83 	alias nothrow int function(int glfwButton, int glfwAction) da_TwEventMouseButtonGLFW;
84 	alias nothrow int function(int glfwKey, int glfwAction) da_TwEventKeyGLFW;
85 	alias nothrow int function(int glfwChar, int glfwAction) da_TwEventCharGLFW;
86 }
87 
88 extern(C)
89 {
90 	alias nothrow int function(int glutButton, int glutState, int mouseX, int mouseY) da_TwEventMouseButtonGLUT;
91 	alias nothrow int function(int mouseX, int mouseY) da_TwEventMouseMotionGLUT;
92 	alias nothrow int function(ubyte glutKey, int mouseX, int mouseY) da_TwEventKeyboardGLUT;
93 	alias nothrow int function(int glutKey, int mouseX, int mouseY) da_TwEventSpecialGLUT;
94 //	alias nothrow int function(int function() glutGetModifiersFunc) da_TwGLUTModifiersFunc;
95 //	alias nothrow int function(const(void)* sfmlEvent, ubyte sfmlMajorVersion, ubyte sfmlMinorVersion) da_TwEventSFML;
96 
97 	/**
98 		Note: The following expect GLFW2 bindings, not GLFW3.
99 		In particular GLFW2 keys do not match GLFW3 keys,
100 		you'll have to translate them if you want to use these functions.
101 	*/
102 	alias nothrow int function(int glfwButton, int glfwAction) da_TwEventMouseButtonGLFWcdecl;
103 	alias nothrow int function(int glfwKey, int glfwAction) da_TwEventKeyGLFWcdecl;
104 	alias nothrow int function(int glfwChar, int glfwAction) da_TwEventCharGLFWcdecl;
105 	alias nothrow int function(int mouseX, int mouseY) da_TwEventMousePosGLFWcdecl;
106 	alias nothrow int function(int wheelPos) da_TwEventMouseWheelGLFWcdecl;
107 }
108 
109 
110 __gshared
111 {
112     da_TwNewBar TwNewBar;
113 	da_TwDeleteBar TwDeleteBar;
114 	da_TwDeleteAllBars TwDeleteAllBars;
115 	da_TwSetTopBar TwSetTopBar;
116 	da_TwGetTopBar TwGetTopBar;
117 	da_TwSetBottomBar TwSetBottomBar;
118 	da_TwGetBottomBar TwGetBottomBar;
119 	da_TwGetBarName TwGetBarName;
120 	da_TwGetBarCount TwGetBarCount;
121 	da_TwGetBarByIndex TwGetBarByIndex;
122 	da_TwGetBarByName TwGetBarByName;
123 	da_TwRefreshBar TwRefreshBar;
124 	da_TwAddVarRW TwAddVarRW;
125 	da_TwAddVarRO TwAddVarRO;
126 	da_TwAddVarCB TwAddVarCB;
127 	da_TwAddButton TwAddButton;
128 	da_TwAddSeparator TwAddSeparator;
129 	da_TwRemoveVar TwRemoveVar;
130 	da_TwRemoveAllVars TwRemoveAllVars;
131 	da_TwDefine TwDefine;
132 	da_TwDefineEnum TwDefineEnum;
133 	da_TwDefineEnumFromString TwDefineEnumFromString;
134 	da_TwDefineStruct TwDefineStruct;
135 	da_TwCopyCDStringToClientFunc TwCopyCDStringToClientFunc;
136 	da_TwCopyCDStringToLibrary TwCopyCDStringToLibrary;
137 	da_TwGetParam TwGetParam;
138 	da_TwSetParam TwSetParam;
139 	da_TwInit TwInit;
140 	da_TwTerminate TwTerminate;
141 	da_TwDraw TwDraw;
142 	da_TwWindowSize TwWindowSize;
143 	da_TwSetCurrentWindow TwSetCurrentWindow;
144 	da_TwGetCurrentWindow TwGetCurrentWindow;
145 	da_TwWindowExists TwWindowExists;
146 	da_TwKeyPressed TwKeyPressed;
147 	da_TwKeyTest TwKeyTest;
148 	da_TwMouseButton TwMouseButton;
149 	da_TwMouseMotion TwMouseMotion;
150 	da_TwMouseWheel TwMouseWheel;
151 	da_TwGetLastError TwGetLastError;
152 	da_TwHandleErrors TwHandleErrors;
153 	da_TwEventWin TwEventWin;
154 	da_TwEventSDL TwEventSDL;
155 	da_TwEventMouseButtonGLFW TwEventMouseButtonGLFW;
156 	da_TwEventKeyGLFW TwEventKeyGLFW;
157 	da_TwEventCharGLFW TwEventCharGLFW;
158 	
159 	da_TwEventMouseButtonGLUT TwEventMouseButtonGLUT;
160 	da_TwEventMouseMotionGLUT TwEventMouseMotionGLUT;
161 	da_TwEventKeyboardGLUT TwEventKeyboardGLUT;
162 	da_TwEventSpecialGLUT TwEventSpecialGLUT;
163 //	da_TwGLUTModifiersFunc TwGLUTModifiersFunc;
164 //	da_TwEventSFML TwEventSFML;
165 	
166 	da_TwEventMouseButtonGLFWcdecl TwEventMouseButtonGLFWcdecl;
167 	da_TwEventKeyGLFWcdecl TwEventKeyGLFWcdecl;
168 	da_TwEventCharGLFWcdecl TwEventCharGLFWcdecl;
169 	da_TwEventMousePosGLFWcdecl TwEventMousePosGLFWcdecl;
170 }